package com.base.common.model.po;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * Po
 * @author yuzhongbo
 * @since 2020-06-03
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "WebOperateLogPo", description = "WebOperateLog对象")
public class WebOperateLogPo implements Serializable {
    private static final long serialVersionUID = 1L;
    @ApiModelProperty(value = "traceId")
    @NotBlank
    private String traceId;
    @ApiModelProperty(value = "spanId")
    @NotBlank
    private String spanId;
    @ApiModelProperty(value = "parentId")
    private String parentId;
    @ApiModelProperty(value = "模块描述")
    private String parentDescription;
    @ApiModelProperty(value = "请求描述")
    private String description;
    @ApiModelProperty(value = "请求时间")
    private String startTimeStr;
    @ApiModelProperty(value = "请求耗时")
    private Integer spendTime;
    @ApiModelProperty(value = "请求服务器")
    private String basePath;
    @ApiModelProperty(value = "请求地址")
    @NotBlank
    private String uri;
    @ApiModelProperty(value = "请求地址描述")
    private String uriDesc;
    @ApiModelProperty(value = "请求详细地址")
    private String url;
    @ApiModelProperty(value = "请求方法")
    private String method;
    @ApiModelProperty(value = "请求服务IP")
    private String ip;
    @ApiModelProperty(value = "请求参数")
    private String parameter;
    @ApiModelProperty(value = "请求结果")
    private String result;
    @ApiModelProperty(value = "请求操作人ID")
    @NotBlank
    private String insertUserId;
    @ApiModelProperty(value = "请求操作人名称")
    @NotBlank
    private String insertUserName;

    @ApiModelProperty(value = "操作开始时间")
    @NotBlank
    private String updateUserId;

    @ApiModelProperty(value = "操作开始时间")
    @NotBlank
    private String updateUserName;
    @ApiModelProperty(value = "所属系统")
    @NotBlank
    private String btSystem;
    @ApiModelProperty(value = "所属用户")
    @NotBlank
    private String btUser;
    @ApiModelProperty(value = "数据权限")
    private String dataPermission;

    @ApiModelProperty(value = "操作开始时间")
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime operateTimeStart;

    @ApiModelProperty(value = "操作结束时间")
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime operateTimeEnd;
}
